import { OpenFunction, OpenType } from '../../Data/Types';
/* eslint-disable */
export class OpenFuncConfig {
  static judgeOpenFunc(condition: OpenFunction[]): boolean {
    for (let i = 0; i < condition.length; i++) {
      const ele = condition[i];
      if (this.judge.has(ele.type)) {
        return this.judge.get(ele.type)(ele.param);
      } else {
        return false;
      }
    }
    return true;
  }

  private static judge: Map<OpenType, (param: number[]) => boolean> = new Map([
    [OpenType.FUNCTION, this.judgeFunction],
    [OpenType.LEVEL, this.judgeLevel],
    [OpenType.KEJI, this.judgeKeJi],
  ]);

  static judgeFunction(param): boolean {
    return true;
  }

  static judgeLevel(param): boolean {
    return true;
  }

  static judgeKeJi(param): boolean {
    return true;
  }
}
